<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>中标管理</title>

    <!-- Favicon -->
    <link rel="shortcut icon" th:href="@{/assets/media/image/favicon.png}"/>

    <!-- Plugin styles -->
    <link rel="stylesheet" th:href="@{/vendors/bundle.css}" type="text/css">

    <!-- Datepicker -->
    <link rel="stylesheet" th:href="@{/vendors/datepicker/daterangepicker.css}">

    <!-- Vmap -->
    <link rel="stylesheet" th:href="@{/vendors/vmap/jqvmap.min.css}">

    <!-- App styles -->
    <link rel="stylesheet" th:href="@{/assets/css/app.css}" type="text/css">

</head>

<body class="container">
<!--自定义宽度-->
<!-- begin::preloader-->
<div class="preloader">
    <div class="preloader-icon"></div>
</div>
<!-- end::preloader -->

<!-- begin::header -->
<div th:replace="~{commons/header :: header}"></div>
<!-- end::header -->

<!-- begin::main -->
<div id="main">
    <!-- begin::navigation -->
    <div th:replace="~{commons/navigation :: navigation}"></div>
    <!-- end::navigation -->

    <!-- begin::main-content -->
    <div class="main-content">
        <!-- begin::page content -->
        <div class="container-fluid">
            <div class="row">
                <!--搜索-->
                <div class="row col-md-12 card">
                    <div class="row anno">
                        <br/>
                        <img th:src="@{/image/anno.png}">
                        投标列表
                    </div>
                    <div>
                        <form th:action="@{/purchaseApply/list}" method="get">
                            <div class="radio" id="radio_div" th:switch="${purchapplyStatus}">
                                投标单状态：
                                <div th:case="null">
                                    <label for="r1"><input id="r1" name="purchapplyStatus" type="radio" value="all"
                                                           checked="checked"/>全部 &nbsp; </label>
                                    <label for="r2"><input id="r2" name="purchapplyStatus" type="radio"
                                                           value="pending"/>待审核 &nbsp;
                                    </label>
                                    <label for="r3"><input id="r3" name="purchapplyStatus" type="radio"
                                                           value="published"/>已发布 &nbsp;
                                    </label>
                                    <label for="r4"><input id="r4" name="purchapplyStatus" type="radio"
                                                           value="rejected"/>已驳回
                                    </label>
                                </div>
                                <div th:case="'pending'">
                                    <label for="r11"><input id="r11" name="purchapplyStatus" type="radio" value="all"/>全部
                                        &nbsp; </label>
                                    <label for="r22"><input id="r22" name="purchapplyStatus" type="radio"
                                                            value="pending"
                                                            checked="checked"/>待审核 &nbsp; </label>
                                    <label for="r33"><input id="r33" name="purchapplyStatus" type="radio"
                                                            value="published"/>已发布 &nbsp;
                                    </label>
                                    <label for="r44"><input id="r44" name="purchapplyStatus" type="radio"
                                                            value="rejected"/>已驳回
                                    </label>
                                </div>
                                <div th:case="'published'">
                                    <label for="r111"><input id="r111" name="purchapplyStatus" type="radio"
                                                             value="all"/>全部 &nbsp; </label>
                                    <label for="r222"><input id="r222" name="purchapplyStatus" type="radio"
                                                             value="pending"/>待审核 &nbsp;
                                    </label>
                                    <label for="r333"><input id="r333" name="purchapplyStatus" type="radio"
                                                             value="published"
                                                             checked="checked"/>已发布 &nbsp; </label>
                                    <label for="r444"><input id="r444" name="purchapplyStatus" type="radio"
                                                             value="rejected"/>已驳回
                                    </label>
                                </div>
                                <div th:case="'rejected'">
                                    <label for="r1111"><input id="r1111" name="purchapplyStatus" type="radio"
                                                              value="all"/>全部 &nbsp; </label>
                                    <label for="r2222"><input id="r2222" name="purchapplyStatus" type="radio"
                                                              value="pending"/>待审核 &nbsp;
                                    </label>
                                    <label for="r3333"><input id="r3333" name="purchapplyStatus" type="radio"
                                                              value="published"/>已发布 &nbsp;
                                    </label>
                                    <label for="r4444"><input id="r4444" name="purchapplyStatus" type="radio"
                                                              value="rejected"
                                                              checked="checked"/>已驳回
                                    </label>
                                </div>
                            </div>
                            <div>
                                单据编号：<input type="text" th:value="${documentNumber}" name="documentNumber"/>
                                供应商名称：<input type="text" th:value="${supplierName}" name="supplierName"/>
                                <input type="submit" id="search1" value="查询"/>
                            </div>
                        </form>
                    </div>
                    <br/>
                    <br/>
                    <div class="table-responsive">
                        <!--表格-->
                        <table id="purchapply_table" class="table table-bordered text-center">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>单据编号</th>
                                <th>供应商名字</th>
                                <th>煤种</th>
                                <th>采购数量(万吨)</th>
                                <th>热卡值</th>
                                <th style="width: 15px">审核日期</th>
                                <th>订单状态</th>
                                <th>操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr th:each="map:${purchaseReleaseList}">
                                <td th:text="${mapStat.count}">1</td>
                                <td th:text="${map.get('document_number')}">2020-danju</td>
                                <td th:text="${map.get('supplier_name')}">供应商</td>
                                <td th:text="${map.get('coaltype')}">烟煤</td>
                                <td th:text="${map.get('procurecount')}">500</td>
                                <td th:text="${map.get('calorievalue')}">5000</td>
                                <td th:text="${#dates.format(map.get('audit_time'),'yyyy-MM-dd HH:mm:ss')}">
                                    2020-7-27
                                </td>
                                <td th:if="${map.get('tenderstatus')=='pending'}">待审核</td>
                                <td th:if="${map.get('tenderstatus')=='published'}">已发布</td>
                                <td th:if="${map.get('tenderstatus')=='rejected'}">已驳回</td>
                                <td th:if="${map.get('tenderstatus')=='pending'}"><a
                                        th:href="@{'/purchaseApply/getPurchaseDetail/'+ ${map.get('tender_id')}}">审核</a>
                                </td>
                                <td th:if="${map.get('tenderstatus')=='published'}"><a
                                        th:href="@{'/purchaseApply/getPurchaseDetail/'+ ${map.get('tender_id')}}">查看</a>
                                </td>
                                <td th:if="${map.get('tenderstatus')=='rejected'}"><a
                                        th:href="@{'/purchaseApply/getPurchaseDetail/'+ ${map.get('tender_id')}}">查看</a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <!--分页-->
                    <div class="row" style="padding-bottom: 15px">
                        <div class="col-sm-12 col-md-6">
                            <div class="dataTables_paginate paging_simple_numbers" id="example2_paginate">
                                <ul class="pagination">
                                    <li class="paginate_button page-item previous disabled"
                                        th:if="${currentPage}==1">
                                        <a href="#" aria-controls="example2" data-dt-idx="0" tabindex="0"
                                           class="page-link"
                                           th:href="@{/purchaseApply/list(purchapplyStatus=${purchapplyStatus},documentNumber=${documentNumber},supplierName=${supplierName},pageIndex=${currentPage -1},pageSize=${pageSize})}">Previous</a>
                                    </li>
                                    <li class="paginate_button page-item previous" th:if="${currentPage}!=1">
                                        <a href="#" aria-controls="example2" data-dt-idx="0" tabindex="0"
                                           class="page-link"
                                           th:href="@{/purchaseApply/list(purchapplyStatus=${purchapplyStatus},documentNumber=${documentNumber},supplierName=${supplierName},pageIndex=${currentPage -1},pageSize=${pageSize})}">Previous</a>
                                    </li>
                                    <div style="display: inline-block" th:each="i:${#numbers.sequence(1,pageNum)}">
                                        <li class="paginate_button page-item active" th:if="${currentPage==i}">
                                            <a href="#" aria-controls="example2" data-dt-idx="1" tabindex="0"
                                               class="page-link" th:text="${i}"
                                               th:href="@{/purchaseApply/list(purchapplyStatus=${purchapplyStatus},documentNumber=${documentNumber},supplierName=${supplierName},pageIndex=${i},pageSize=${pageSize})}">1</a>
                                        </li>
                                        <li class="paginate_button page-item" th:if="${currentPage!=i}">
                                            <a href="#" aria-controls="example2" data-dt-idx="1" tabindex="0"
                                               class="page-link" th:text="${i}"
                                               th:href="@{/purchaseApply/list(purchapplyStatus=${purchapplyStatus},documentNumber=${documentNumber},supplierName=${supplierName},pageIndex=${i},pageSize=${pageSize})}">1</a>
                                        </li>
                                    </div>
                                    <li class="paginate_button page-item disabled" th:if="${currentPage==pageNum}">
                                        <a href="#" aria-controls="example2" data-dt-idx="7" tabindex="0"
                                           class="page-link"
                                           th:href="@{/purchaseApply/list(purchapplyStatus=${purchapplyStatus},documentNumber=${documentNumber},supplierName=${supplierName},pageIndex=${currentPage+1},pageSize=${pageSize})}">Next</a>
                                    </li>
                                    <li class="paginate_button page-item next" th:if="${currentPage!=pageNum}">
                                        <a href="#" aria-controls="example2" data-dt-idx="7" tabindex="0"
                                           class="page-link"
                                           th:href="@{/purchaseApply/list(purchapplyStatus=${purchapplyStatus},documentNumber=${documentNumber},supplierName=${supplierName},pageIndex=${currentPage+1},pageSize=${pageSize})}">Next</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                        <div class="col-sm-12 col-md-6">
                            <div class="dataTables_info" style="line-height: 34px" id="example2_info" role="status"
                                 aria-live="polite">
                                <label th:text="'Showing 1 to 6 of '+ ${count} + ' entries'"></label>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- end::page content -->

        <!-- begin::footer -->
        <footer>
            <div class="container-fluid">
                <div>© 2019 Protable v1.0.0 Made by <a href="http://bootstrapmb.com">Laborasyon</a>
                </div>
                <div>
                    <nav class="nav">
                        <a href="" class="nav-link">Licenses</a>
                        <a href="#" class="nav-link">Change Log</a>
                        <a href="#" class="nav-link">Get Help</a>
                    </nav>
                </div>
            </div>
        </footer>
        <!-- end::footer -->
    </div>
    <!-- end::main-content -->
</div>
<!-- end::main -->
<div th:include="~{commons/scripts :: scripts}"></div>

<!-- App scripts -->
<script th:src="@{/assets/js/app.js}"></script>
</body>
</html>